package com.enzoism.springboot.fastjson.request;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
public class UserModel implements Serializable {
    private Integer id;
    private String name;

    //com.alibaba.fastjson.annotation.JSONField
    @JSONField(format="yyyy-MM-dd HH")
    private Date createTime;

    /*
     * serialize:是否需要序列化属性.
     */
    @JSONField(serialize=false)
    private String remarks;//备注信息.

    @NotNull(message = "nickName不能为空")
    private String nickName;

    @Min(value = 1,message = "age不能小于1")
    @Max(value = 120,message = "age不能大于120")
    private Integer age;





}
